package com.softer.wxzj.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.softer.wxzj.common.entity.Page;
import com.softer.wxzj.entity.RetentionMoney;
import com.softer.wxzj.mapper.RetentionMoneyMapper;
import com.softer.wxzj.service.RetentionMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Gong Zhiyang
 * @date 2019/8/13
 */
@Service
public class RetentionMoneyServiceImpl implements RetentionMoneyService {
    @Autowired
    private RetentionMoneyMapper retentionMoneyMapper;

    /**
     * 获取质保金使用返还列表
     *
     * @param page  分页实体
     * @param fuzzy 模糊查询字段
     * @return 列表
     */
    @Override
    public PageInfo<RetentionMoney> getRetentionMoney(Page page, String fuzzy) {
        PageHelper.startPage(page.getPageNum(), page.getPageSize());
        List<RetentionMoney> list = retentionMoneyMapper.getRetentionMoney(fuzzy);
        PageInfo<RetentionMoney> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
